//-------------------------------------------------------------------
//	Copyright (c) 2010-2014  Zhirnov Andrey
//	This file is part of the "UX Standard Lib" project.
//	See copyright notice in "UX_DataBase.h".
//-------------------------------------------------------------------

#ifndef _UXS_UTF8_STRING_UTILS_H
#define _UXS_UTF8_STRING_UTILS_H

#pragma once

#include "../../stl_core/ux_stl_core.h"
//#include "String.h"

namespace UX_STL
{
namespace UXDataBase
{
	using namespace UXTypes;



	//
	// UTF-8 String Utils
	//

	struct Utf8StringUtils
	{
		static void EncodeToWindows1251 (uni_c_string src, OUT string &dst);

		static usize Length (const char *s)
		{
			usize len = 0;
			while (*s)
			{
				len += ( (*s++) & 0xc0 ) != 0x80;
			}
			return len;
		}
	};

	
//-------------------------------------------------------------------

}	// UXDataBase
}	// UX_STL

#endif	// _UXS_UTF8_STRING_UTILS_H